<?php

class My_Controller_Plugin_Model extends Zend_Controller_Plugin_Abstract
{
    public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
    {
        $moduleName = $request->getModuleName();
        
        set_include_path( get_include_path() . PATH_SEPARATOR . 
                          APPLICATION_PATH . '/modules/' . $moduleName . '/models/generated' . PATH_SEPARATOR .
                          APPLICATION_PATH . '/modules/' . $moduleName . '/models' . PATH_SEPARATOR .
                          APPLICATION_PATH . '/modules/default/models/generated' . PATH_SEPARATOR .
                          APPLICATION_PATH . '/modules/default/models' );
    }
}